package com.nsn.vs.sdm.adapt.auto;

import java.io.File;

import com.nsn.vs.sdm.util.file.UtilFile;

public class ApplicationCore 
{
	public static final String WORKSPACE_ADAPT_PATH = "adaptDir";
	public static final String WORKSPACE_CFILE = "cFile";
	public static final String WORKSPACE_COMPDESCR = "compDescr";
	public static final String WORKSPACE_COMPDESCR_DESCRIP = "descriptors";
	
	/**
	 * make the workspace
	 * @param adaptRel
	 * @param buildNum
	 */
	public static void createWorkspace (final String adaptRel, final String buildNum)
	{
		createWorkspace(adaptRel, buildNum, "_");
	}
	
	
	/**
	 * 
	 * @param adaptRel
	 * @param buildNum
	 * @param seperator
	 */
	public static void createWorkspace (final String adaptRel, 
			final String buildNum, final String seperator)
	{
		String baseFolder = adaptRel + seperator + buildNum;
		if( new File(baseFolder).exists())
			UtilFile.delFolder(baseFolder);
		UtilFile.createFolder(baseFolder);
		UtilFile.createFolder(baseFolder + File.separator + WORKSPACE_ADAPT_PATH);
		UtilFile.createFolder(baseFolder + File.separator + WORKSPACE_CFILE);
		UtilFile.createFolder(baseFolder + File.separator + WORKSPACE_COMPDESCR);
		UtilFile.createFolder(baseFolder + File.separator +WORKSPACE_COMPDESCR+File.separator+ WORKSPACE_COMPDESCR_DESCRIP);
	}
	
	public static void main (String[] args)
	{
		ApplicationCore.createWorkspace("4.5EP5", "1.0.58");
		//ApplicationCore.createWorkspace("5.0", "1.0.58", "____");
	}
	
}
